package com.zxy.ziems.server.classify.pojo.dto;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import lombok.Data;

import java.math.BigDecimal;
import java.util.List;

/**
 * @author 10348359
 * @create 2024-04-09 19:00
 */
@Data
public class ClassifyDevicePropertyDTO {

    /**
     * 主键ID
     */
    @NotBlank(message = "主键不能为空", groups = {Update.class, Delete.class})
    @Null(message = "主键必须为空", groups = {Add.class, AddList.class})
    private String id;

    /**
     * 分类id
     */
    @NotBlank(message = "分类id不能为空", groups = {Update.class, Add.class, AddList.class})
    private String classifyId;

    /**
     * 设备id
     */
    @NotBlank(message = "设备id不能为空", groups = {Update.class, Add.class})
    private String deviceId;

    /**
     * 设备集
     */
    @NotEmpty(message = "设备集不可为空", groups = {AddList.class})
    private List<String> deviceIds;

    /**
     * 设备参数Id
     */
    @NotBlank(message = "设备参数Id不能为空", groups = {Update.class, Add.class, AddList.class})
    private String dataTypeId;

    /**
     * 倍率 系数
     */
    private BigDecimal multiple;

    /**
     * 计算方式：1.实时值，2.增量值 3.辅助计算值
     */
    @NotNull(message = "计算方式不能为空", groups = {Add.class, Update.class, AddList.class})
    private Integer calculateType;

    /**
     * 计算公式
     */
    private String calculateFunction;


    public interface Add {}
    public interface Update {}
    public interface Delete {}

    public interface AddList {}
}
